package cn.edu.scau.cmi.wujiaxian.composite.safe;

public class Person extends Organization {

	public Person(Organization parent, String name) {
		super(parent, name);
	}

	@Override
	public String toString() {
		return toString(1);
	}

	@Override
	String toString(int cent) {
		String parentName = getParent() == null ? "无" : getParent().getName();
		String blank = StringUtils.repeat("	", cent - 1);
		return  blank + "\"" + getName() + "\"" + ": " + "{" + "\n"
				+ blank + "	" + "\"" + "类型" + "\"" + ": " + "\"" + "个人" + "\"" + "," + "\n"
				+ blank + "	" + "\"" + "父亲" + "\"" + ": " + "\"" + parentName + "\"" + "\n"
				+ blank + "}" + "\n";
	}

}

